create or replace view vac_app_page_ir_comp_4_1 as
with vv as
 (select
    APPLICATION_ID,
    APPLICATION_NAME,
    APPLICATION_USER,
    COMPUTATION_COLUMN_ALIAS,
    COMPUTATION_COLUMN_IDENTIFIER,
    COMPUTATION_COLUMN_TYPE,
    COMPUTATION_EXPRESSION,
    COMPUTATION_FORMAT_MASK,
    COMPUTATION_FORM_LABEL,
    COMPUTATION_ID,
    COMPUTATION_REPORT_LABEL,
    CREATED_BY,
    CREATED_ON,
    INTERACTIVE_REPORT_ID,
    LAST_UPDATED_BY,
    LAST_UPDATED_ON,
    PAGE_ID,
    REPORT_ID,
    REPORT_NAME,
    WORKSPACE,
    WORKSPACE_DISPLAY_NAME
  from APEX_APPLICATION_PAGE_IR_COMP aa
  )
  select
      APPLICATION_ID,
      APPLICATION_NAME,
      APPLICATION_USER,
      COMPUTATION_COLUMN_ALIAS,
      COMPUTATION_ID,
      CREATED_BY,
      CREATED_ON,
      INTERACTIVE_REPORT_ID,
      LAST_UPDATED_BY,
      LAST_UPDATED_ON,
      PAGE_ID,
      REPORT_ID,
      REPORT_NAME,
      WORKSPACE,
      WORKSPACE_DISPLAY_NAME,
      U_NAME,
      U_VALUE,
      'VAC_APPLICATION_PAGE_IR_COMP' src_view_name
  from vv UNPIVOT INCLUDE NULLS(u_value FOR u_name IN(
      COMPUTATION_COLUMN_IDENTIFIER,
      COMPUTATION_COLUMN_TYPE,
      COMPUTATION_EXPRESSION,
      COMPUTATION_FORMAT_MASK,
      COMPUTATION_FORM_LABEL,
      COMPUTATION_REPORT_LABEL
                                                     )
                               );

